﻿using System;
using System.Collections.Generic;
using Citi.PTSConsolidation.SchedulerUI.Bases;
using Citi.RoutineBase;
using System.Configuration;
using System.IO;

namespace Citi.PTSConsolidation.SchedulerUI
{
    internal class ClientMonthlyVarianceReportGeneration : MonthlyReportGeneration
    {
        private static string PtsReportSavePath { get { return ConfigurationManager.AppSettings["PtsReportSavePath"]; } }

        internal override List<string> ColumnsToMerge { get { return new List<string> { "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L" }; } }
        internal override List<string> ColumnsToDate { get { return new List<string> { "M", "O", "R", "U", "X", "AA" }; } }
        //internal override string ReportPath { get; set; }
        internal override string ReportName { get { return "MonthlyClientVariance"; } }
        internal override string TemplatePath { get { return ConfigurationManager.AppSettings["TemplateExcelPtsClientMonthly"]; } }
        //internal override string FriendlyName { get; set; }
        internal override string MonthlyReportWithConnections { get { return ConfigurationManager.AppSettings["ClientMonthlyPartial"]; } }

        public void GenerateReport(string yearReportName, int year, DateTime referenceDate, ref ICurrentAction currentAction)
        {
            FriendlyName = string.Format("PTS Monthly Client Veariance Report ({0})", yearReportName);
            ReportPath = Path.Combine(PtsReportSavePath, "Monthly Client Variance", year.ToString());
            GenerateReport(referenceDate, year, ref currentAction);
        }
    }

    public class ClientMonthlyVariancePreviousYearReportGeneration : ReportPreviousYear, IExecutableRoutine
    {
        protected override void ExecuteProcess(DateTime referenceDate, ref ICurrentAction currentAction, string networkUser, string networkPassword, Dictionary<string, object> parameters)
        {
            new ClientMonthlyVarianceReportGeneration().GenerateReport("Previous Year", referenceDate.Year - 1, referenceDate, ref currentAction);
        }
    }

    public class ClientMonthlyVarianceCurrentYearReportGeneration : ReportCurrentYear
    {
        protected override void ExecuteProcess(DateTime referenceDate, ref ICurrentAction currentAction, string networkUser, string networkPassword, Dictionary<string, object> parameters)
        {
            new ClientMonthlyVarianceReportGeneration().GenerateReport("Current Year", referenceDate.Year, referenceDate, ref currentAction);
        }
    }

    public class ClientMonthlyVarianceNextYearReportGeneration : ReportNextYear, IExecutableRoutine
    {
        protected override void ExecuteProcess(DateTime referenceDate, ref ICurrentAction currentAction, string networkUser, string networkPassword, Dictionary<string, object> parameters)
        {
            new ClientMonthlyVarianceReportGeneration().GenerateReport("Next Year", referenceDate.Year + 1, referenceDate, ref currentAction);
        }
    }

    //public class ClientMonthlyVariancePreviousYearReportGeneration : ReportPreviousYear,  IExecutableRoutine
    //{
    //    protected override void ExecuteProcess(DateTime referenceDate, ref ICurrentAction currentAction, string networkUser, string networkPassword, Dictionary<string, object> parameters)
    //    {
    //        ReportGenerationHelper.GenerateClientMonthlyVarianceReportYear(referenceDate.Year - 1, referenceDate, ref currentAction, parameters, "Previous Year");
    //    }
    //}

    //public class ClientMonthlyVarianceCurrentYearReportGeneration : ReportCurrentYear
    //{
    //    protected override void ExecuteProcess(DateTime referenceDate, ref ICurrentAction currentAction, string networkUser, string networkPassword, Dictionary<string, object> parameters)
    //    {
    //        ReportGenerationHelper.GenerateClientMonthlyVarianceReportYear(referenceDate.Year, referenceDate, ref currentAction, parameters, "Current Year");
    //    }
    //}

    //public class ClientMonthlyVarianceNextYearReportGeneration : ReportNextYear, IExecutableRoutine
    //{
    //    protected override void ExecuteProcess(DateTime referenceDate, ref ICurrentAction currentAction, string networkUser, string networkPassword, Dictionary<string, object> parameters)
    //    {
    //        ReportGenerationHelper.GenerateClientMonthlyVarianceReportYear(referenceDate.Year + 1, referenceDate, ref currentAction, parameters, "Next Year");
    //    }
    //}

    public class ClientJustificationMonthlyVariancePreviousYearReportGeneration : ReportPreviousYear, IExecutableRoutine
    {
        protected override void ExecuteProcess(DateTime referenceDate, ref ICurrentAction currentAction, string networkUser, string networkPassword, Dictionary<string, object> parameters)
        {
            ReportGenerationHelper.GenerateClientJustificationMonthlyVarianceReportYear(referenceDate.Year - 1, referenceDate, ref currentAction, parameters, "Previous Year");
        }
    }

    public class ClientJustificationMonthlyVarianceCurrentYearReportGeneration : ReportCurrentYear
    {
        protected override void ExecuteProcess(DateTime referenceDate, ref ICurrentAction currentAction, string networkUser, string networkPassword, Dictionary<string, object> parameters)
        {
            ReportGenerationHelper.GenerateClientJustificationMonthlyVarianceReportYear(referenceDate.Year, referenceDate, ref currentAction, parameters, "Current Year");
        }
    }

    public class ClientJustificationMonthlyVarianceNextYearReportGeneration : ReportNextYear, IExecutableRoutine
    {
        protected override void ExecuteProcess(DateTime referenceDate, ref ICurrentAction currentAction, string networkUser, string networkPassword, Dictionary<string, object> parameters)
        {
            ReportGenerationHelper.GenerateClientJustificationMonthlyVarianceReportYear(referenceDate.Year + 1, referenceDate, ref currentAction, parameters, "Next Year");
        }
    }
}